feat(server/main) export to create job account#74
Merged
uShifty merged 5 commits intoRenewed-Scripts:mainfrom Feb 19, 2025
Merged
feat(server/main) export to create job account#74uShifty merged 5 commits intoRenewed-Scripts:mainfrom
uShifty merged 5 commits intoRenewed-Scripts:mainfrom
Conversation
Added an export CreateJobAccount() to add new job accounts in runtime. Very useful for scripts utilizing in-game job/shop creators.
Contributor
|
Is there a reason to return the cachedAccount table back to the export caller? I believe this should return true/false with true being the account was created and false if the account exists or fails to create. |
Contributor
Author
Very useful when creating accounts in runtime, avoiding calling another export to retrieve the account data of the newly created account. If you prefer true/false return, I can rework the commit - however; imo it makes sense to return the created account. |
improved function with parameter checks, database insert succession and return true/false
Changed function behavior to return the account table instead of boolean and string. Errors are now raised instead of returning false, providing better debugging with the invoking resource name. Returning the account table allows direct access to account data without needing to use an export to retrieve it separately. This improves usability by ensuring that the function itself provides the necessary data instead of requiring an additional call.
Added the `GetJobAccount` function to retrieve a cached job account if it exists.
- Returns the job account table if found, otherwise `nil`.
- Raises an error if `jobName` is invalid (not a string or empty).
- Uses `GetInvokingResource()` for clearer debugging when an invalid job name is provided.
- Exposes the function as an export (`exports('GetJobAccount', GetJobAccount)`) for external access.
This improves usability by providing a way to fetch job account details and not just the account balance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an export CreateJobAccount() to add new job accounts in runtime. Very useful for scripts utilizing in-game job/shop creators.
EDIT:
Also added GetJobAccountt() to retrieve a cached job account if it exists